import cv2
import  matplotlib.pyplot as plt
import  numpy as np
 
img = cv2.imread("/Users/vine/Desktop/50.jpg")
# img = img[0:500,0:2000]
# 分离RGB，OpenCV中的通道为B G R ，所以0代表B通道。
b,g,r = cv2.split(img)
img1 = img.copy()
# img1[:,:,0] = 0
img1[:,:,1] = 0
img1[:,:,2] = 0
cv2.imshow("R",img1)
cv2.imwrite('/Users/vine/Desktop/R.jpg', img1)
cv2.waitKey(0)
cv2.destroyAllWindows()